<html>
<head>
	<title>Leveller --- Daylon Leveller heightfield</title>
</head>

<body bgcolor="#ffffff">

<h1>Leveller --- Daylon Leveller Heightfield</h1>

Leveller heightfields store 32-bit elevation values.
Format versions 4 through 7 are supported with various caveats 
(see below). The file extension for Leveller heightfields is "TER" (which 
is the same as Terragen, but the driver only recognizes Leveller files).<p>

Blocks are organized as pixel-high scanlines (rows), with the first scanline 
at the top (north) edge of the DEM, and adjacent pixels on each line 
increasing from left to right (west to east).<p>

The band type is always Float32, even though format versions 4 and 5 
physically use 16.16 fixed-point. The driver autoconverts them to 
floating-point.<p>


<h2>Reading</h2>
<tt>dataset::GetProjectionRef()</tt> will return only a local coordinate system 
for file versions 4 through 6.<p>

<tt>dataset::GetGeoTransform()</tt> returns a simple world scaling with a centered 
origin for formats 4 through 6. For version 7, it returns a realworld transform 
except for rotations. The identity transform is not considered an error condition; 
Leveller documents often use them.<p>

<tt>band::GetUnitType()</tt> will report the measurement units used 
by the file instead of converting unusual types to meters.
A list of unit types is in the <tt>levellerdataset.cpp</tt> module.<p>

<tt>band::GetScale()</tt> and <tt>band::GetOffset()</tt> will 
return the physical-to-logical (i.e., raw to realworld) transform 
for the elevation data.<p>


<h2>Writing</h2>
The <tt>dataset::Create()</tt> call is supported, but for version 7 files only.<p>

<tt>band::SetUnitType()</tt> can be set to any of the unit types listed 
in the <tt>levellerdataset.cpp</tt> module.<p>

<tt>dataset::SetGeoTransform()</tt> should not include rotation data.<p>

As with the Terragen driver, the <tt>MINUSERPIXELVALUE</tt> option must be 
specified. This lets the driver correctly map from logical (realworld) elevations 
to physical elevations.<p>

Header information is written out on the first call to <tt>band::IWriteBlock</tt>.<p>

<h2>History</h2>
v1.2 (Jul 17/07): Added v7 and Create support.<p>
v1.1 (Oct 20/05): Fixed coordsys and elev scaling errors.<p>

<h2>See Also:</h2>

<ul>
<li> Implemented as <tt>gdal/frmts/leveller/levellerdataset.cpp</tt>.<p>

<li> <a href="http://www.daylongraphics.com/products/leveller/dev/index.htm">
Leveller SDK</a>, which documents the Leveller format.<p>

</ul>


</body>
</html>

